<?php    
session_start();
include 'student.php';
include_once 'data_access.php';
$connect=new database_access();
$connect->connect();

$student=new student();
$student->personalnumber=$_POST['nationalid'];
$student->password=$_POST['student_password'];
   $check=$student->login($student->personalnumber,$student->password);
   echo$check;
   if($check!=0){
   $_SESSION['personalnumber']=$student->personalnumber;
   $_SESSION['name']=$check;
      header('location: index.php');
       }
   else{
       session_destroy();
include 'login.php';
echo"<script language='javascript' type='text/javascript'>
alert('من فضلك ادخل بيانات صحيحة');
</script>";
   }
?>